/// @Classname : HcButtonPage
/// @Author :
/// @Time : 2023-11-14 14:51
/// @Description : //按钮的展示页面

import 'package:flutter/material.dart';
import 'package:hc_ui/config/hc_customer_config.dart';
import 'package:hc_ui/theme/hc_title_theme.dart';
import 'package:hc_ui/widget/button/hc_base_button.dart';
import 'package:hc_ui/widget/button/hc_elevated_button.dart';
import 'package:hc_ui/widget/button/hc_outline_button.dart';
import 'package:hc_ui/widget/button/hc_text_button.dart';
import 'package:hc_ui/widget/title/hc_title.dart';

class HcButtonPage extends StatefulWidget {
  const HcButtonPage({Key? key}) : super(key: key);

  @override
  State<HcButtonPage> createState() => _HcButtonPageState();
}

class _HcButtonPageState extends State<HcButtonPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: HcCustomerConfig().allTheme.commonTheme.fillPageColor,
      appBar: AppBar(
        title: const Text("HcButtonPage"),
      ),
      body: ListView(
        padding: EdgeInsets.symmetric(
            vertical: HcCustomerConfig().allTheme.commonTheme.vSpacingPage,
            horizontal: HcCustomerConfig().allTheme.commonTheme.hSpacingPage),
        children: [
          const HcTitle.dot(
            title: "文字按钮",
          ),
          Row(
            children: [
              HcTextButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                disabled: false,
                text: "可用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcTextButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                disabled: true,
                text: "禁用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcTextButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                // disabled: true,
                loading: true,
                text: "加载中",
              ),
            ],
          ),
          const SizedBox(
            height: 8,
          ),
          HcTextButton(
            onPressed: () => {},
            text: '文字按钮',
          ),
          HcTitle.dot(
            title: "实体按钮",
            // subtitle: "最小Size(64,36),默认文字颜色为primaryColor",
            themeData: HcTitleTheme(
                titleStyle: TextStyle(
                    fontSize:
                        HcCustomerConfig().allTheme.commonTheme.fontSizeTitle,
                    color:
                        HcCustomerConfig().allTheme.commonTheme.primaryColor)),
          ),
          Row(
            children: [
              HcElevatedButton(
                backgroundColor: Colors.yellow,
                onPressed: () => {},
                // disabled: false,
                text: "可用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcElevatedButton(
                backgroundColor: Colors.yellow,
                onPressed: () => {},
                disabled: true,
                text: "禁用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcElevatedButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                loading: true,
                text: "加载中",
              ),
            ],
          ),
          const SizedBox(
            height: 8,
          ),
          HcElevatedButton(
            onPressed: () => {},
            text: '实体按钮',
          ),
          HcTitle.dot(
            title: "边框按钮",
            // subtitle: "最小Size(64,36),默认文字颜色为primaryColor",
            themeData: HcTitleTheme(
                titleStyle: TextStyle(
                    fontSize:
                        HcCustomerConfig().allTheme.commonTheme.fontSizeTitle,
                    color:
                        HcCustomerConfig().allTheme.commonTheme.primaryColor)),
          ),
          Row(
            children: [
              HcOutlinedButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                // disabled: false,
                text: "可用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcOutlinedButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                disabled: true,
                text: "禁用的按钮",
              ),
              const SizedBox(
                width: 8,
              ),
              HcOutlinedButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                loading: true,
                text: "加载中",
              ),
            ],
          ),
          const SizedBox(
            height: 8,
          ),
          HcOutlinedButton(
            onPressed: () => {},
            text: '边框按钮',
          ),
          HcTitle.dot(
            title: "基础按钮",
            // subtitle: "最小Size(64,36),默认文字颜色为primaryColor",
            themeData: HcTitleTheme(
                titleStyle: TextStyle(
                    fontSize:
                        HcCustomerConfig().allTheme.commonTheme.fontSizeTitle,
                    color:
                        HcCustomerConfig().allTheme.commonTheme.primaryColor)),
          ),
          Row(
            children: [
              HcBaseButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                // disabled: false,
                text: "可用的按钮", elevation: 2,
              ),
              const SizedBox(
                width: 8,
              ),
              HcBaseButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                disabled: true,
                text: "禁用的按钮", elevation: 2,
              ),
              const SizedBox(
                width: 8,
              ),
              HcBaseButton(
                // textColor: Colors.yellow,
                onPressed: () => {},
                loading: true,
                text: "加载中", elevation: 2,
              ),
            ],
          ),
          const SizedBox(
            height: 8,
          ),
          HcBaseButton(
            onPressed: () => {},
            text: '基础按钮',
            elevation: 2,
          ),
        ],
      ),

      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
